<h2>Deliver <%= @promotion_mail.subject %></h2>
<%= form_tag(do_deliver_promotion_mail_path(@promotion_mail), html: {class: 'form-horizontal', id: 'form-send-mail'}) do %>
    <div class="row">
      <h3>User groups</h3>
    </div>
    <div class="row">
      <div class="col-lg-4">
        <div class="form-group">
          <select id="user_group_selector" size="15" class="form-control" multiple>
             <%= options_from_collection_for_select @user_groups, :id, :name %>
          </select>
        </div>
      </div>
      <div class="col-lg-1">
        <div id="add-groups" class="btn btn-info">&Gt;</div>
        <br/><br/>
        <div id="remove-groups" class="btn btn-info">&Lt;</div>
      </div>
      <div class="col-lg-4">
        <select id="user_group_ids" name="user_group_ids[]" size="15" class="form-control" multiple></select>
      </div>
    </div>
    <div class="row">
      <h3>Individuals</h3>
    </div>
    <div class="row">
      <div class="col-lg-4">
        <div class="form-group">
          <div id="search-users" class="input-group">
            <input type="text" class="form-control" placeholder="Search">
            <span class="input-group-btn">
              <button class="btn btn-warning" type="button"><i class="fa fa-search"></i></button>
            </span>
          </div>
        </div>
        <div class="form-group">
          <select id="user_selector" size="12" class="form-control" multiple>
            <%= render partial: 'search' %>
          </select>
        </div>
      </div>
      <div class="col-lg-1">
        <div id="add-users" class="btn btn-info">&Gt;</div>
        <br/><br/>
        <div id="remove-users" class="btn btn-info">&Lt;</div>
      </div>
      <div class="col-lg-4">
        <select id="user_ids" name="user_ids[]" size="15" class="form-control" multiple></select>
      </div>
    </div>
    <fieldset>
      <div class="form-group">
        <div class="col-lg-12">
          <%= submit_tag 'Send', id: 'send', class: 'btn btn-primary' %>
        </div>
      </div>
    </fieldset>
<% end %>